/*
 * VentanaPrincipal.java
 *
 * Created on 21 de diciembre de 2007, 13:43
 */

package dpoo.gui;

import dpoo.control.*;
import dpoo.figuras.*;
import javax.swing.JComponent;

/**
 *
 * @author  david
 */
public class VentanaPrincipal extends javax.swing.JFrame {
    
    Control control = Control.instancia();
    MetodoDialog metodoDialog;
    ParametroDialog paramDialog;
    AtributoDialog atributoDialog;
    AcercaDe acercaDeDialog;
    
    /** Creates new form VentanaPrincipal */
    public VentanaPrincipal() {
        this.control.setVentanaPrincipal(this);
        this.control.cambiarComportamientoSeleccionar();
        
        //inicalizo los cuadros de diálogo que usaré posteriormente
        this.metodoDialog = new MetodoDialog(this, true);
        this.metodoDialog.pack();
        this.paramDialog = new ParametroDialog(this, true);
        this.paramDialog.pack();
        this.atributoDialog = new AtributoDialog(this, true);
        this.atributoDialog.pack();
        this.acercaDeDialog = new AcercaDe(this, true);
        this.acercaDeDialog.pack();
        
        initComponents();
        
        this.desactivarPanelClase();
        this.desactivarPanelMetodos();
        this.desactivarPanelAtributos();
    }
    
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        toggleGroup = new javax.swing.ButtonGroup();
        visibilidadGroup = new javax.swing.ButtonGroup();
        modificadoresGroup = new javax.swing.ButtonGroup();
        statusBar = new javax.swing.JLabel();
        jToolBar = new javax.swing.JToolBar();
        toggleSeleccionar = new javax.swing.JToggleButton();
        toggleClase = new javax.swing.JToggleButton();
        toggleHerencia = new javax.swing.JToggleButton();
        jSplitPane1 = new javax.swing.JSplitPane();
        jSplitPane2 = new javax.swing.JSplitPane();
        jScrollPane2 = new javax.swing.JScrollPane();
        jEditorPane = new javax.swing.JEditorPane();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jScrollPaneClase = new javax.swing.JScrollPane();
        jPanelClase = new javax.swing.JPanel();
        claseNombreLabel = new javax.swing.JLabel();
        claseNombre = new javax.swing.JTextField();
        claseHeredaDeLabel = new javax.swing.JLabel();
        claseHeredaDe = new javax.swing.JTextField();
        claseVisiLabel = new javax.swing.JLabel();
        claseVisiPublica = new javax.swing.JRadioButton();
        claseVisiPrivada = new javax.swing.JRadioButton();
        claseVisiPaquete = new javax.swing.JRadioButton();
        claseVisiProtegido = new javax.swing.JRadioButton();
        claseModLabel = new javax.swing.JLabel();
        claseModAbstracta = new javax.swing.JCheckBox();
        claseModFinal = new javax.swing.JCheckBox();
        jScrollPaneMetodos = new javax.swing.JScrollPane();
        jPanelMetodos = new javax.swing.JPanel();
        metodosLabel = new javax.swing.JLabel();
        jScrollPane3 = new javax.swing.JScrollPane();
        jListMetodos = new javax.swing.JList();
        metodosAnadir = new javax.swing.JButton();
        metodosModificar = new javax.swing.JButton();
        metodosEliminar = new javax.swing.JButton();
        jScrollPaneAtributos = new javax.swing.JScrollPane();
        jPanelAtributos = new javax.swing.JPanel();
        atributosLabel = new javax.swing.JLabel();
        jScrollPane4 = new javax.swing.JScrollPane();
        jListAtributos = new javax.swing.JList();
        atributosAnadir = new javax.swing.JButton();
        atributosModificar = new javax.swing.JButton();
        atributosEliminar = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTree = new javax.swing.JTree();
        jMenuBar = new javax.swing.JMenuBar();
        jMenuArchivo = new javax.swing.JMenu();
        salirMenuItem = new javax.swing.JMenuItem();
        jMenuAyuda = new javax.swing.JMenu();
        acercaDeMenuItem = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Prácticas DPOO");
        setMinimumSize(new java.awt.Dimension(800, 600));

        statusBar.setText("jLabel1");
        getContentPane().add(statusBar, java.awt.BorderLayout.PAGE_END);

        jToolBar.setRollover(true);

        toggleGroup.add(toggleSeleccionar);
        toggleSeleccionar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/dpoo/gui/Selector.gif"))); // NOI18N
        toggleSeleccionar.setSelected(true);
        toggleSeleccionar.setFocusable(false);
        toggleSeleccionar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        toggleSeleccionar.setMaximumSize(new java.awt.Dimension(32, 32));
        toggleSeleccionar.setMinimumSize(new java.awt.Dimension(32, 32));
        toggleSeleccionar.setPreferredSize(new java.awt.Dimension(32, 32));
        toggleSeleccionar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        toggleSeleccionar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                toggleSeleccionarActionPerformed(evt);
            }
        });
        jToolBar.add(toggleSeleccionar);

        toggleGroup.add(toggleClase);
        toggleClase.setIcon(new javax.swing.ImageIcon(getClass().getResource("/dpoo/gui/Class.gif"))); // NOI18N
        toggleClase.setFocusable(false);
        toggleClase.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        toggleClase.setMaximumSize(new java.awt.Dimension(32, 32));
        toggleClase.setMinimumSize(new java.awt.Dimension(32, 32));
        toggleClase.setPreferredSize(new java.awt.Dimension(32, 32));
        toggleClase.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        toggleClase.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                toggleClaseActionPerformed(evt);
            }
        });
        jToolBar.add(toggleClase);

        toggleGroup.add(toggleHerencia);
        toggleHerencia.setIcon(new javax.swing.ImageIcon(getClass().getResource("/dpoo/gui/Generalization.gif"))); // NOI18N
        toggleHerencia.setFocusable(false);
        toggleHerencia.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        toggleHerencia.setMaximumSize(new java.awt.Dimension(32, 32));
        toggleHerencia.setMinimumSize(new java.awt.Dimension(32, 32));
        toggleHerencia.setPreferredSize(new java.awt.Dimension(32, 32));
        toggleHerencia.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        toggleHerencia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                toggleHerenciaActionPerformed(evt);
            }
        });
        jToolBar.add(toggleHerencia);

        getContentPane().add(jToolBar, java.awt.BorderLayout.PAGE_START);

        jSplitPane1.setDividerLocation(130);
        jSplitPane1.setOneTouchExpandable(true);

        jSplitPane2.setDividerLocation(285);
        jSplitPane2.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);

        jEditorPane.setEditable(false);
        jEditorPane.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jEditorPaneMouseClicked(evt);
            }
        });
        jScrollPane2.setViewportView(jEditorPane);

        jSplitPane2.setTopComponent(jScrollPane2);

        jPanelClase.setMinimumSize(new java.awt.Dimension(331, 174));
        jPanelClase.setPreferredSize(new java.awt.Dimension(331, 160));

        claseNombreLabel.setFont(new java.awt.Font("Dialog", 1, 12));
        claseNombreLabel.setText("Nombre:");

        claseHeredaDeLabel.setFont(new java.awt.Font("Dialog", 1, 12));
        claseHeredaDeLabel.setText("Hereda de:");

        claseVisiLabel.setFont(new java.awt.Font("Dialog", 1, 12));
        claseVisiLabel.setText("Visibilidad:");

        visibilidadGroup.add(claseVisiPublica);
        claseVisiPublica.setText("Pública");
        claseVisiPublica.setActionCommand(dpoo.control.cons.PUBLICO);
        claseVisiPublica.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                claseActionPerformed(evt);
            }
        });

        visibilidadGroup.add(claseVisiPrivada);
        claseVisiPrivada.setText("Privada");
        claseVisiPrivada.setActionCommand(dpoo.control.cons.PRIVADO);
        claseVisiPrivada.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                claseActionPerformed(evt);
            }
        });

        visibilidadGroup.add(claseVisiPaquete);
        claseVisiPaquete.setSelected(true);
        claseVisiPaquete.setText("Paquete");
        claseVisiPaquete.setActionCommand(dpoo.control.cons.PAQUETE);
        claseVisiPaquete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                claseActionPerformed(evt);
            }
        });

        visibilidadGroup.add(claseVisiProtegido);
        claseVisiProtegido.setText("Protegido");
        claseVisiProtegido.setActionCommand(dpoo.control.cons.PROTEGIDO);
        claseVisiProtegido.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                claseActionPerformed(evt);
            }
        });

        claseModLabel.setFont(new java.awt.Font("Dialog", 1, 12));
        claseModLabel.setText("Modificadores:");

        modificadoresGroup.add(claseModAbstracta);
        claseModAbstracta.setText("Abstracta");
        claseModAbstracta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                claseActionPerformed(evt);
            }
        });

        modificadoresGroup.add(claseModFinal);
        claseModFinal.setText("Final");
        claseModFinal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                claseActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanelClaseLayout = new javax.swing.GroupLayout(jPanelClase);
        jPanelClase.setLayout(jPanelClaseLayout);
        jPanelClaseLayout.setHorizontalGroup(
            jPanelClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelClaseLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelClaseLayout.createSequentialGroup()
                        .addGroup(jPanelClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(claseNombreLabel)
                            .addComponent(claseHeredaDeLabel))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(claseNombre, javax.swing.GroupLayout.DEFAULT_SIZE, 451, Short.MAX_VALUE)
                            .addComponent(claseHeredaDe, javax.swing.GroupLayout.DEFAULT_SIZE, 451, Short.MAX_VALUE)))
                    .addGroup(jPanelClaseLayout.createSequentialGroup()
                        .addComponent(claseVisiLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(claseVisiPaquete)
                            .addComponent(claseVisiPrivada))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(claseVisiPublica)
                            .addComponent(claseVisiProtegido)))
                    .addGroup(jPanelClaseLayout.createSequentialGroup()
                        .addComponent(claseModLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(claseModFinal)
                            .addComponent(claseModAbstracta))))
                .addContainerGap())
        );
        jPanelClaseLayout.setVerticalGroup(
            jPanelClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelClaseLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(claseNombreLabel)
                    .addComponent(claseNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(claseHeredaDeLabel)
                    .addComponent(claseHeredaDe, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanelClaseLayout.createSequentialGroup()
                        .addGroup(jPanelClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(claseVisiLabel)
                            .addComponent(claseVisiPaquete))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(claseVisiPrivada))
                    .addGroup(jPanelClaseLayout.createSequentialGroup()
                        .addComponent(claseVisiProtegido)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(claseVisiPublica)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(claseModLabel)
                    .addComponent(claseModAbstracta))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(claseModFinal)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jScrollPaneClase.setViewportView(jPanelClase);

        jTabbedPane1.addTab("Clase", jScrollPaneClase);

        jPanelMetodos.setPreferredSize(new java.awt.Dimension(476, 160));

        metodosLabel.setFont(new java.awt.Font("Dialog", 1, 12));
        metodosLabel.setText("Métodos:");

        jScrollPane3.setViewportView(jListMetodos);

        metodosAnadir.setText("Añadir");
        metodosAnadir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                metodosAnadirActionPerformed(evt);
            }
        });

        metodosModificar.setText("Modificar");
        metodosModificar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                metodosModificarActionPerformed(evt);
            }
        });

        metodosEliminar.setText("Eliminar");
        metodosEliminar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                metodosEliminarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanelMetodosLayout = new javax.swing.GroupLayout(jPanelMetodos);
        jPanelMetodos.setLayout(jPanelMetodosLayout);
        jPanelMetodosLayout.setHorizontalGroup(
            jPanelMetodosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelMetodosLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelMetodosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 528, Short.MAX_VALUE)
                    .addComponent(metodosLabel)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelMetodosLayout.createSequentialGroup()
                        .addComponent(metodosAnadir)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(metodosModificar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(metodosEliminar)))
                .addContainerGap())
        );
        jPanelMetodosLayout.setVerticalGroup(
            jPanelMetodosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelMetodosLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(metodosLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelMetodosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(metodosEliminar)
                    .addComponent(metodosModificar)
                    .addComponent(metodosAnadir))
                .addContainerGap())
        );

        jScrollPaneMetodos.setViewportView(jPanelMetodos);

        jTabbedPane1.addTab("Métodos", jScrollPaneMetodos);

        jPanelAtributos.setPreferredSize(new java.awt.Dimension(476, 160));

        atributosLabel.setFont(new java.awt.Font("Dialog", 1, 12));
        atributosLabel.setText("Atributos:");

        jScrollPane4.setViewportView(jListAtributos);

        atributosAnadir.setText("Añadir");
        atributosAnadir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                atributosAnadirActionPerformed(evt);
            }
        });

        atributosModificar.setText("Modificar");
        atributosModificar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                atributosModificarActionPerformed(evt);
            }
        });

        atributosEliminar.setText("Eliminar");
        atributosEliminar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                atributosEliminarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanelAtributosLayout = new javax.swing.GroupLayout(jPanelAtributos);
        jPanelAtributos.setLayout(jPanelAtributosLayout);
        jPanelAtributosLayout.setHorizontalGroup(
            jPanelAtributosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelAtributosLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelAtributosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 528, Short.MAX_VALUE)
                    .addComponent(atributosLabel)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelAtributosLayout.createSequentialGroup()
                        .addComponent(atributosAnadir)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(atributosModificar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(atributosEliminar)))
                .addContainerGap())
        );
        jPanelAtributosLayout.setVerticalGroup(
            jPanelAtributosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelAtributosLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(atributosLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelAtributosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(atributosEliminar)
                    .addComponent(atributosModificar)
                    .addComponent(atributosAnadir))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jScrollPaneAtributos.setViewportView(jPanelAtributos);

        jTabbedPane1.addTab("Atributos", jScrollPaneAtributos);

        jSplitPane2.setBottomComponent(jTabbedPane1);

        jSplitPane1.setRightComponent(jSplitPane2);

        jScrollPane1.setViewportView(jTree);

        jSplitPane1.setLeftComponent(jScrollPane1);

        getContentPane().add(jSplitPane1, java.awt.BorderLayout.CENTER);

        jMenuArchivo.setText("Archivo");

        salirMenuItem.setText("Salir");
        jMenuArchivo.add(salirMenuItem);

        jMenuBar.add(jMenuArchivo);

        jMenuAyuda.setText("Ayuda");

        acercaDeMenuItem.setText("Acerca de");
        acercaDeMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                acercaDeMenuItemActionPerformed(evt);
            }
        });
        jMenuAyuda.add(acercaDeMenuItem);

        jMenuBar.add(jMenuAyuda);

        setJMenuBar(jMenuBar);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jEditorPaneMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jEditorPaneMouseClicked
        this.control.ventanaPrincipalMouseClicked(evt);
    }//GEN-LAST:event_jEditorPaneMouseClicked

    private void toggleSeleccionarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_toggleSeleccionarActionPerformed
        this.control.cambiarComportamientoSeleccionar();
    }//GEN-LAST:event_toggleSeleccionarActionPerformed

    private void toggleClaseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_toggleClaseActionPerformed
        this.control.cambiarComportamientoClase();
    }//GEN-LAST:event_toggleClaseActionPerformed

    private void toggleHerenciaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_toggleHerenciaActionPerformed
        this.control.cambiarComportamientoHerencia();
    }//GEN-LAST:event_toggleHerenciaActionPerformed

    private void metodosAnadirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_metodosAnadirActionPerformed
        this.metodoDialog.setVisible(true);
}//GEN-LAST:event_metodosAnadirActionPerformed

    private void atributosAnadirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_atributosAnadirActionPerformed
        this.atributoDialog.setVisible(true);
}//GEN-LAST:event_atributosAnadirActionPerformed

    private void atributosModificarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_atributosModificarActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_atributosModificarActionPerformed

    private void atributosEliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_atributosEliminarActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_atributosEliminarActionPerformed

    private void metodosModificarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_metodosModificarActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_metodosModificarActionPerformed

    private void metodosEliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_metodosEliminarActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_metodosEliminarActionPerformed

    private void acercaDeMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_acercaDeMenuItemActionPerformed
        this.acercaDeDialog.setVisible(true);
}//GEN-LAST:event_acercaDeMenuItemActionPerformed

    private void claseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_claseActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_claseActionPerformed

    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new VentanaPrincipal().setVisible(true);
            }
        });
    }
    
    public void anadirJComponent(JComponent componente) {
        this.jEditorPane.add(componente);
        this.jEditorPane.repaint();
        
    }
    
    public void mostrarInfoFiguraClase(FiguraClase clase) {
        this.claseNombre.setText(clase.getNombre());
        //this.claseHeredaDe
        switch(clase.getVisibilidad()) {
            case 0: //pública
                
        }
    }
    
    private void activarPanelClase() {
        this.claseNombreLabel.setEnabled(true);
        this.claseNombre.setEnabled(true);
        this.claseHeredaDeLabel.setEnabled(true);
        this.claseHeredaDe.setEnabled(true);
        this.claseModLabel.setEnabled(true);
        this.claseModAbstracta.setEnabled(true);
        this.claseModFinal.setEnabled(true);
        this.claseVisiLabel.setEnabled(true);
        this.claseVisiPaquete.setEnabled(true);
        this.claseVisiPrivada.setEnabled(true);
        this.claseVisiProtegido.setEnabled(true);
        this.claseVisiPublica.setEnabled(true);
    }
    
    private void desactivarPanelClase() {
        this.claseNombreLabel.setEnabled(false);
        this.claseNombre.setEnabled(false);
        this.claseHeredaDeLabel.setEnabled(false);
        this.claseHeredaDe.setEnabled(false);
        this.claseModLabel.setEnabled(false);
        this.claseModAbstracta.setEnabled(false);
        this.claseModFinal.setEnabled(false);
        this.claseVisiLabel.setEnabled(false);
        this.claseVisiPaquete.setEnabled(false);
        this.claseVisiPrivada.setEnabled(false);
        this.claseVisiProtegido.setEnabled(false);
        this.claseVisiPublica.setEnabled(false);
    }
    
    private void activarPanelMetodos() {
        this.metodosLabel.setEnabled(true);
        this.jListMetodos.setEnabled(true);
        this.metodosAnadir.setEnabled(true);
        this.metodosModificar.setEnabled(true);
        this.metodosEliminar.setEnabled(true);
    }
    
    private void desactivarPanelMetodos() {
        this.metodosLabel.setEnabled(false);
        this.jListMetodos.setEnabled(false);
        this.metodosAnadir.setEnabled(false);
        this.metodosModificar.setEnabled(false);
        this.metodosEliminar.setEnabled(false);
    }
    
    private void activarPanelAtributos() {
        this.atributosLabel.setEnabled(true);
        this.jListAtributos.setEnabled(true);
        this.atributosAnadir.setEnabled(true);
        this.atributosModificar.setEnabled(true);
        this.atributosEliminar.setEnabled(true);
    }
    
    private void desactivarPanelAtributos() {
        this.atributosLabel.setEnabled(false);
        this.jListAtributos.setEnabled(false);
        this.atributosAnadir.setEnabled(false);
        this.atributosModificar.setEnabled(false);
        this.atributosEliminar.setEnabled(false);
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuItem acercaDeMenuItem;
    private javax.swing.JButton atributosAnadir;
    private javax.swing.JButton atributosEliminar;
    private javax.swing.JLabel atributosLabel;
    private javax.swing.JButton atributosModificar;
    private javax.swing.JTextField claseHeredaDe;
    private javax.swing.JLabel claseHeredaDeLabel;
    private javax.swing.JCheckBox claseModAbstracta;
    private javax.swing.JCheckBox claseModFinal;
    private javax.swing.JLabel claseModLabel;
    private javax.swing.JTextField claseNombre;
    private javax.swing.JLabel claseNombreLabel;
    private javax.swing.JLabel claseVisiLabel;
    private javax.swing.JRadioButton claseVisiPaquete;
    private javax.swing.JRadioButton claseVisiPrivada;
    private javax.swing.JRadioButton claseVisiProtegido;
    private javax.swing.JRadioButton claseVisiPublica;
    private javax.swing.JEditorPane jEditorPane;
    private javax.swing.JList jListAtributos;
    private javax.swing.JList jListMetodos;
    private javax.swing.JMenu jMenuArchivo;
    private javax.swing.JMenu jMenuAyuda;
    private javax.swing.JMenuBar jMenuBar;
    private javax.swing.JPanel jPanelAtributos;
    private javax.swing.JPanel jPanelClase;
    private javax.swing.JPanel jPanelMetodos;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPaneAtributos;
    private javax.swing.JScrollPane jScrollPaneClase;
    private javax.swing.JScrollPane jScrollPaneMetodos;
    private javax.swing.JSplitPane jSplitPane1;
    private javax.swing.JSplitPane jSplitPane2;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JToolBar jToolBar;
    private javax.swing.JTree jTree;
    private javax.swing.JButton metodosAnadir;
    private javax.swing.JButton metodosEliminar;
    private javax.swing.JLabel metodosLabel;
    private javax.swing.JButton metodosModificar;
    private javax.swing.ButtonGroup modificadoresGroup;
    private javax.swing.JMenuItem salirMenuItem;
    private javax.swing.JLabel statusBar;
    private javax.swing.JToggleButton toggleClase;
    private javax.swing.ButtonGroup toggleGroup;
    private javax.swing.JToggleButton toggleHerencia;
    private javax.swing.JToggleButton toggleSeleccionar;
    private javax.swing.ButtonGroup visibilidadGroup;
    // End of variables declaration//GEN-END:variables
    
}
